package com.lzx.article.utils;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author 程序员星星
 * @date 2023/1/12
 * @Description
 */
public class TypeConversion {
    //字符串转list
    public static List<String> stringToList(String s) {
        List<String> list = Arrays.asList(s
                .replaceAll("(\\[)", "")
                .replaceAll("(])", "")
                .replaceAll("( )", "")
                .split(","));
        //去重
        return list.stream().distinct().collect(Collectors.toList());
    }
}
